<template>
  <div>
    <el-input placeholder="请输入内容" size="large" v-model="color" @input="onChange">
      <template slot="prepend">
        <el-color-picker size="mini" show-alpha color-format="rgb" v-model="color" @active-change="e => onChange(e)" @change="e => onChange(e)"></el-color-picker>
       
      </template>
    </el-input>
   
  </div>
</template>

<script>
export default {
  name: "InputColorPicker",
  emits:['onChange'],
  props:{
    value:{
      default () {
        return ''
      }
    }
  },
  data () {
    return {
      color:''
    }
  },
  created () {
    this.color = this.value
  },
  methods:{
    onChange(e) {
      this.color = e
      this.$emit('onChange',this.color)
    }
  }
};
</script>

<style>
</style>